<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>model</title>
	<meta name="author" content="Stark" />
	<!-- Date: 2018-10-24 -->
	<script type="text/javascript" src="jquery-1.8.3.js"></script>
	<script type="text/javascript">
		$(function() {
			// 获取存在有ul的li,has返回的是新包装集
			$("li").has("ul").css("color","#f00").end().css("background","#00f");
			
			$("div").has("span").css("color","#0f0");
			
		});
	</script> 
</head>
<body>
	<div>
		<span class="s1">sssssssssssss</span>
	</div>
	<div>
		<span>
			2222222222222222222222
		</span>
	</div>
	<div>
		<ul class="u1">
			<li>aaaaaaaaaaaaaa</li>
		</ul>
	</div>
	
	<ul>
		<li>aaaa</li>
		<li>bbbb</li>
		<li>
			<ul>
				<li>ccccccccc1</li>
				<li>ccccccccc2</li>
			</ul>
		</li>
		<li>dddddd</li>
	</ul>
</body>
</html>

